using System;
using Common.Enumerations;
using Sanelib.Dto;

namespace Common.Commands.TaskLogCommands
{
    public class AddTaskLog : AuditedCommand
    {
        public TaskStatus TaskStatus { get; set; }        

        public override Guid? GetAggregateId()
        {
            return Id;
        }

        public override ErrorResult Validate()
        {
            var validationResult = new ErrorResult();

            if(string.IsNullOrWhiteSpace(Name))
                validationResult.AddError("Task Name","should not be empty.");

            if(TaskStatus == null)
                validationResult.AddError("Task Status", "should not be empty.");

            return validationResult;
        }
    }
}